#include "software_pwm_library.h"
#include <softPwm.h>

//software-pwm-library
PHP_FUNCTION(softPwmCreate)
{
    zend_long pin;
    zend_long initialValue;
    zend_long pwmRange;

	ZEND_PARSE_PARAMETERS_START(3, 3)
		Z_PARAM_LONG(pin)
		Z_PARAM_LONG(initialValue)
        Z_PARAM_LONG(pwmRange)
	ZEND_PARSE_PARAMETERS_END();

    softPwmCreate(pin, initialValue, pwmRange);
}

PHP_FUNCTION(softPwmWrite)
{
    zend_long pin;
    zend_long value;

	ZEND_PARSE_PARAMETERS_START(2, 2)
		Z_PARAM_LONG(pin)
        Z_PARAM_LONG(value)
	ZEND_PARSE_PARAMETERS_END();

    softPwmWrite(pin, value);
}
//end for software-pwm-library